package com.sx.service.system;

import com.alibaba.fastjson.JSONObject;
import com.sx.basic.pageable.Condition;
import com.sx.entity.system.ConfigEntity;
import com.sx.mapper.system.ConfigMapper;
import com.sx.basic.BasicService;
import com.sx.basic.impl.BasicServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author AdinZ
 * @date 2020/11/7 17:57
 */
@Service
public class ConfigService extends BasicServiceImpl<ConfigMapper, ConfigEntity>
        implements BasicService<ConfigEntity> , IConfigService {


    @Override
    public JSONObject findConfig(String groupKey) {
        List<ConfigEntity> list = super.findList(new Condition().eq("group_key", groupKey));
        return ConfigEntity.toMap(list);
    }
}
